Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed typeName management in override #203

Closed
wants to merge 1 commit into from

Conversation

rdeioris
Copy link
Contributor

@rdeioris rdeioris commented Oct 28, 2024

Assuming two layers with the first one refering the second:

base.usda

#usda 1.0

def Scope "Root"
{
    def Scope "SubRoot"
    (
        prepend references = @hello.usda@
    )
    {
        def Mesh "HelloWorld"
        {
            
        }
    }
}

hello.usda

#usda 1.0
(
    defaultPrim = "Main"
)

def "Main"
{
    def "HelloWorld"
    {
        string value = "Hello World"
    }
}

The flattened result should be (output from usdcat):

#usda 1.0
(
)

def Scope "Root"
{
    def Scope "SubRoot"
    {
        def Mesh "HelloWorld"
        {
            string value = "Hello World"
        }
    }
}

While tusdcat returns

#usda 1.0

def Scope "Root"
{
    def Scope "SubRoot"
    {
        def "HelloWorld"
        {
            string value = "Hello World"
        }
    }
}

The reason is that the code assumes typeName to always be available while USD allows it to be omitted (like in the example).

The patch honours the original typeName if none is specified in the referenced asset

@syoyo
Copy link
Collaborator

syoyo commented Oct 28, 2024

in dev branch,

$ tusdcat --flatten base.udsa

gives the following result

#usda 1.0

def Scope "Root"
{
}

so there is another issue to be fixed in tinyusdz.
Also, please first submit github issue with minimal reproducible code/usd file with expected result, if the fix is not obvious like this PR's case.

@rdeioris
Copy link
Contributor Author

rdeioris commented Oct 28, 2024

Note that tusdcat is basically broken in the Stage creation (i am debugging it), the output i pasted is from intermediate stage (where it outputs the various composition phases).

So you prefer to have an issue in addition to the pull request if it is a bugfix?

@rdeioris
Copy link
Contributor Author

@syoyo closing this, as i have realized that there are more corner cases in the composition logic that require a heavier refactoring. I am going to open an issue as soon as i have a full grasp of what are the missieng pieces. Thanks again for your support

@rdeioris rdeioris closed this Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants